博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Download all Apple open source OS X files at once
阅读量:6681 次
发布时间:2019-06-25

本文共 2490 字,大约阅读时间需要 8 分钟。

While it is well known that Mac OS X contains open source code, how to access and download that source code is perhaps less well known. Apple publishes all its open source code on their 
. However, this site makes you download each program individually, without an obvious option to download an entire OS X release at once (i.e., all public sources for 10.6.1). 


So I wrote the following 
bash
 script to automate the download procedure. It downloads the individual tarballs for each program, expands them locally, and then rolls everything up into one big tarball for local storage. Some caveats are that this script does not build the code, and that you are bound by a variety of licenses which are not included here (because no Apple code is included here).
#!/usr/bin/env bash# --- applesource.bash --- downloads source code for an entire Apple release# Take input from command-line (use "10.5.8", "10.6.1", etc.)  version="mac-os-x-`echo $* | tr -d "."`"# URL:  homepage="http://www.opensource.apple.com"  URL="${homepage}/release/${version}/"# Announce beginning, and prepare a directory for the untarred sources  echo "Preparing to download..."  sources="./${version}-sources"  mkdir -p ${sources}  # Process the webpage for the locations of the tarballs themselves  curl --silent ${URL} | sed -n 's//\1/p' | \    while read line; do          # Find and announce the name of the next tarball to be downloaded        tarball=".${line}"        echo -e "\nDownloading `basename ${tarball}`..."      # Download the tarball and keep Apple's original directory structure intact        curl --create-dirs --output ${tarball} "${homepage}${line}"      # Untar into the "sources" directory (see line 13)        tar xfz "${tarball}" -C ${sources}    done# Compress all sourcefiles into a single tarball for posterity  echo "Creating ${version}.tar.gz from all sources..."  tar cfvz "${version}.tar.gz" ${sources}# Explicitly show that everything finished.  echo "Done."# I like for my Mac to talk to me, although sometimes this can be creepy.  say "The source of ${version} is now ready."
Save the above somewhere on your path, make it executable (
chmod a+x scriptname
), and then run it with the version number you'd like to download: 
getsource 10.6.1
, for instance. I am a bit shy about releasing my scripts, so please be gentle! 
以上转自:
另附:非常有用的参考网址:
tar包下载地址(全): /
source在线查看(全): /
release发布包下载地址:
Mac OS X 10.6.2: /
Mac OS X 10.8:   /
脚本下载地址:

转载于:https://www.cnblogs.com/sesexxoo/p/6189911.html

你可能感兴趣的文章
.NET项目web自动化测试实战——Selenium 2.0
查看>>
[LeetCode] Split Concatenated Strings 分割串联字符串
查看>>
Asp.Net SignalR - 持久连接类
查看>>
11.8. NAT
查看>>
PowerShell调用jira rest api实现jira统计自动化
查看>>
Git 时间,将代码托管到GitHub 上
查看>>
火车票秒杀攻略
查看>>
关于Asp.Net中FileUpload控件属性PostedFile.ContentType的提示
查看>>
Laravel5做权限管理
查看>>
Spring 通过Java代码装配bean
查看>>
架构重构-好文分享
查看>>
使用shell批量生成数据整合式迁移的脚本
查看>>
[20151021]理解dbms_xplan.display_cursor的format参数all.txt
查看>>
Unicode字符编码标准
查看>>
云计算就像是产业链的重新组合
查看>>
第三代北斗芯片发布 2020年北斗计划向全球提供服务
查看>>
阿里巴巴集团CTO王坚:云计算让理想平等
查看>>
《中国人工智能学会通讯》——11.30 深度迁移学习
查看>>
Dell EMC扩充数据保护产品线 Data Domain增强云分层功能
查看>>
美柚社区精选:贴心宝妈的八大育儿经验
查看>>